#pragma once

// Qt's
#include <QPushButton>

#include "../gant_global_define.h"

class QMouseEvent;
class QTimerEvent;
class LoadingButton2Private;
class GANT_EXPORT LoadingButton2 : public QPushButton
{
    Q_OBJECT

public:
    explicit LoadingButton2(QWidget *parent = nullptr);
    ~LoadingButton2();

    void setMovie(const QString& filePath);
    void setMovie(QMovie* movie);
    QMovie* movie() const;

    void setTimeout(int timeout);
    int timeout() const;

protected:
    void mouseReleaseEvent(QMouseEvent* me) override;
    void timerEvent(QTimerEvent* te) override;

signals:
    void sgnTimeout();

private:
    GANT_DECL_PRIVATE(LoadingButton2);
};
